import java.util.PriorityQueue;

public class TestDemo {
    public static void main(String[] args) {
        //默认容量是11    小根堆
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(10);
        priorityQueue.offer(8);
        priorityQueue.offer(30);
        priorityQueue.offer(5);

        System.out.println(priorityQueue.poll());//5
        System.out.println(priorityQueue.peek());//8
    }
}
